题目
Prove that the following two languages are undecidable.
b. PREFIX-FREE = .
思路
点击展开
对 5.21 略作修改,让骨牌匹配等价于找到 CFG 的一个字符串是另一个字符串的前缀
解答
点击展开
对 5.21 的 Hint 修改,增加 ,调整 的位置,结果如下:
Given an instance
of the Post Correspondence Problem, construct a CFG with the rules
where are new terminal symbols.
如果存在骨牌匹配,即 ,那么 是 的前缀,且两者均在 中
反之,如果存在 中的相异字符串 M 是 N 的前缀, 部分必须相同,这代表 M 和 N 分别由 T 和 B 生成,否则 M 和 N 相同。进而,